/*
 * @Author: yyf
 * @Date: 2018-04-27
 * @description: 事件--退出方
*/

import { apiHttp } from '../../apiHttp';
import exitApi from '../../../api/event/eventExitController.api';
import { JsonResult, EventExitDto } from '../../../api/Interface';
import { EventPublicSearchDto } from '../../../service/event/Interface';


export default {
    // 退出方列表
    getEventExitPage: async (eventExitPage: EventPublicSearchDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(exitApi.eventExitPage, eventExitPage);
        return res;
    },
    // 添加退出方
    addExitEvent: async (eventExitDto: EventExitDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(exitApi.saveEventExit, eventExitDto);
        return res;
    },
    // 编辑退出方
    updateEventExit: async (eventExitDto: EventExitDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(exitApi.updateEventExit, eventExitDto);
        return res;
    },
    // 删除退出方
    deleteEventExit: async (id: number): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(exitApi.deleteEventExit, {id});
        return res;
    },
    // 计算退出回报率
    computeIncomeCalculation: async (eventExitDto: EventExitDto ): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(exitApi.computeIncomeCalculation, eventExitDto );
        return res;
    },

};